from flask import request


def getClientIp():
    try:
        if request.headers.getlist("X-Forwarded-For"):
            get_remote_ip = request.headers.getlist("X-Forwarded-For")[0]
        else:
            get_remote_ip = request.remote_addr
    except Exception as e:
        get_remote_ip = '-'
    return get_remote_ip.replace('127.0.0.1', '').replace(', ', '')
